<ion-header>
    <ion-toolbar content-page>
        <ion-buttons start>
            <button ion-button icon-only navPop>
                <i class="back"></i>
            </button>
        </ion-buttons>
        <ion-title>
            名单筛选
        </ion-title>
        <!--<ion-buttons end>
            <button ion-button icon-only adpmenutoggle>
                <i class="toolbar-menu"></i>
            </button>
        </ion-buttons>-->
    </ion-toolbar>
</ion-header>

<ion-content>
    <div class="item-container">
        <div class="block origin">
            <div class="title">
                名单来源
            </div>
            <div class="content-container">
                <button (click)="originClick(item)"
                        [ngClass]="{'selected':item.selected}" *ngFor="let item of conditions.origins">
                    {{item.title}}
                </button>
            </div>
        </div>

        <div class="block create-time">
            <div class="title">
                建档日期
                <button class="clear-btn" *ngIf="conditions.starttime||conditions.endtime" (click)="clearTime('normal')">清除
                </button>
            </div>
            <div class="content-container">
                <div class="time-selector">

                    <ion-datetime cancelText="取消" doneText="确定" displayFormat="YYYY/MM/DD" pickerFormat="YYYYMMDD"
                                  yearValues="{{yearList}}" [class.datetime_error]="normalErr" (ionChange)="normalChange()"
                                  [pickerOptions]="pickerOptions" [(ngModel)]="conditions.starttime">
                    </ion-datetime>
                    <div class="division">
                    </div>
                    <ion-datetime cancelText="取消" doneText="确定" displayFormat="YYYY/MM/DD" pickerFormat="YYYYMMDD"
                                  yearValues="{{yearList}}" [class.datetime_error]="normalErr"  (ionChange)="normalChange()"
                                  [pickerOptions]="pickerOptions" [(ngModel)]="conditions.endtime">
                    </ion-datetime>

                </div>
            </div>
        </div>

        <div class="block process">
            <div class="title">
                增员进度
            </div>
            <div class="content-container">
                <button (click)="processClick(item)"
                        [ngClass]="{'selected':item.selected,'is-first':i === 0}" *ngFor="let item of conditions.process;index as i">
                    {{item.title}}
                </button>
            </div>
        </div>

        <div class="block create-time">
            <div class="title">
                时间范围
                <button class="clear-btn" *ngIf="conditions.processStartTime||conditions.processEndTime" (click)="clearTime('process')">清除
                </button>
            </div>
            <div class="content-container">
                <div class="time-selector">

                    <ion-datetime cancelText="取消" doneText="确定" displayFormat="YYYY/MM" pickerFormat="YYYYMM"
                                  yearValues="{{yearList}}" [class.datetime_error]="processErr" (ionChange)="processChange()"
                                  [pickerOptions]="pickerOptions" [(ngModel)]="conditions.processStartTime">
                    </ion-datetime>
                    <div class="division">
                    </div>
                    <ion-datetime cancelText="取消" doneText="确定" displayFormat="YYYY/MM" pickerFormat="YYYYMM"
                                  yearValues="{{yearList}}" [class.datetime_error]="processErr"  (ionChange)="processChange()"
                                  [pickerOptions]="pickerOptions" [(ngModel)]="conditions.processEndTime">
                    </ion-datetime>

                </div>
            </div>
        </div>



    </div>

    <div class="tool-wrapper">
        <button (click)="reset($event)">
            重置
        </button>
        <button (click)="finish($event)" [disabled]="normalErr||processErr">
            查询
        </button>
    </div>
</ion-content>
